package com.evenmo.util;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

/**
 * 
 * @author moyongjun
 *
 */
public class HibernateUtil {

	/**
	 * 获取session
	 * @return
	 */
	public static Session getSession(){
		
		Configuration configuration = new Configuration();
		configuration.configure("hibernate.cfg.xml");
		SessionFactory sessionFactory = configuration.buildSessionFactory();
		Session session = sessionFactory.openSession();
		return session;
	}


	
}
